home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Fonts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  10.0 KB  |  373 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Fonts.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __FONTS__
  13. #define __FONTS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. enum  {
  23.     systemFont                    = 0,
  24.     applFont                    = 1,
  25.     newYork                        = 2,
  26.     geneva                        = 3,
  27.     monaco                        = 4,
  28.     venice                        = 5,
  29.     london                        = 6,
  30.     athens                        = 7,
  31.     sanFran                        = 8,
  32.     toronto                        = 9,
  33.     cairo                        = 11,
  34.     losAngeles                    = 12,
  35.     times                        = 20,
  36.     helvetica                    = 21,
  37.     courier                        = 22,
  38.     symbol                        = 23,
  39.     mobile                        = 24,
  40.     commandMark                    = 17,
  41.     checkMark                    = 18,
  42.     diamondMark                    = 19
  43. };
  44.  
  45. enum  {
  46.     appleMark                    = 20,
  47.     propFont                    = 36864,
  48.     prpFntH                        = 36865,
  49.     prpFntW                        = 36866,
  50.     prpFntHW                    = 36867,
  51.     fixedFont                    = 45056,
  52.     fxdFntH                        = 45057,
  53.     fxdFntW                        = 45058,
  54.     fxdFntHW                    = 45059,
  55.     fontWid                        = 44208
  56. };
  57.  
  58. #if defined(powerc) || defined (__powerc)
  59. #pragma options align=mac68k
  60. #endif
  61. struct FMInput {
  62.     short                        family;
  63.     short                        size;
  64.     Style                        face;
  65.     Boolean                        needBits;
  66.     short                        device;
  67.     Point                        numer;
  68.     Point                        denom;
  69. };
  70. #if defined(powerc) || defined(__powerc)
  71. #pragma options align=reset
  72. #endif
  73.  
  74. typedef struct FMInput FMInput;
  75.  
  76. #if defined(powerc) || defined (__powerc)
  77. #pragma options align=mac68k
  78. #endif
  79. struct FMOutput {
  80.     short                        errNum;
  81.     Handle                        fontHandle;
  82.     unsigned char                boldPixels;
  83.     unsigned char                italicPixels;
  84.     unsigned char                ulOffset;
  85.     unsigned char                ulShadow;
  86.     unsigned char                ulThick;
  87.     unsigned char                shadowPixels;
  88.     char                        extra;
  89.     unsigned char                ascent;
  90.     unsigned char                descent;
  91.     unsigned char                widMax;
  92.     char                        leading;
  93.     char                        curStyle;
  94.     Point                        numer;
  95.     Point                        denom;
  96. };
  97. #if defined(powerc) || defined(__powerc)
  98. #pragma options align=reset
  99. #endif
  100.  
  101. typedef struct FMOutput FMOutput;
  102.  
  103. typedef FMOutput *FMOutPtr;
  104.  
  105. #if defined(powerc) || defined (__powerc)
  106. #pragma options align=mac68k
  107. #endif
  108. struct FontRec {
  109.     short                        fontType;                        /*font type*/
  110.     short                        firstChar;                        /*ASCII code of first character*/
  111.     short                        lastChar;                        /*ASCII code of last character*/
  112.     short                        widMax;                            /*maximum character width*/
  113.     short                        kernMax;                        /*negative of maximum character kern*/
  114.     short                        nDescent;                        /*negative of descent*/
  115.     short                        fRectWidth;                        /*width of font rectangle*/
  116.     short                        fRectHeight;                    /*height of font rectangle*/
  117.     unsigned short                owTLoc;                            /*offset to offset/width table*/
  118.     short                        ascent;                            /*ascent*/
  119.     short                        descent;                        /*descent*/
  120.     short                        leading;                        /*leading*/
  121.     short                        rowWords;                        /*row width of bit image / 2 */
  122. };
  123. #if defined(powerc) || defined(__powerc)
  124. #pragma options align=reset
  125. #endif
  126.  
  127. typedef struct FontRec FontRec;
  128.  
  129. #if defined(powerc) || defined (__powerc)
  130. #pragma options align=mac68k
  131. #endif
  132. struct FMetricRec {
  133.     Fixed                        ascent;                            /*base line to top*/
  134.     Fixed                        descent;                        /*base line to bottom*/
  135.     Fixed                        leading;                        /*leading between lines*/
  136.     Fixed                        widMax;                            /*maximum character width*/
  137.     Handle                        wTabHandle;                        /*handle to font width table*/
  138. };
  139. #if defined(powerc) || defined(__powerc)
  140. #pragma options align=reset
  141. #endif
  142.  
  143. typedef struct FMetricRec FMetricRec;
  144.  
  145. #if defined(powerc) || defined (__powerc)
  146. #pragma options align=mac68k
  147. #endif
  148. struct WidEntry {
  149.     short                        widStyle;                        /*style entry applies to*/
  150. };
  151. #if defined(powerc) || defined(__powerc)
  152. #pragma options align=reset
  153. #endif
  154.  
  155. typedef struct WidEntry WidEntry;
  156.  
  157. #if defined(powerc) || defined (__powerc)
  158. #pragma options align=mac68k
  159. #endif
  160. struct WidTable {
  161.     short                        numWidths;                        /*number of entries - 1*/
  162. };
  163. #if defined(powerc) || defined(__powerc)
  164. #pragma options align=reset
  165. #endif
  166.  
  167. typedef struct WidTable WidTable;
  168.  
  169. #if defined(powerc) || defined (__powerc)
  170. #pragma options align=mac68k
  171. #endif
  172. struct AsscEntry {
  173.     short                        fontSize;
  174.     short                        fontStyle;
  175.     short                        fontID;                            /*font resource ID*/
  176. };
  177. #if defined(powerc) || defined(__powerc)
  178. #pragma options align=reset
  179. #endif
  180.  
  181. typedef struct AsscEntry AsscEntry;
  182.  
  183. #if defined(powerc) || defined (__powerc)
  184. #pragma options align=mac68k
  185. #endif
  186. struct FontAssoc {
  187.     short                        numAssoc;                        /*number of entries - 1*/
  188. };
  189. #if defined(powerc) || defined(__powerc)
  190. #pragma options align=reset
  191. #endif
  192.  
  193. typedef struct FontAssoc FontAssoc;
  194.  
  195. #if defined(powerc) || defined (__powerc)
  196. #pragma options align=mac68k
  197. #endif
  198. struct StyleTable {
  199.     short                        fontClass;
  200.     long                        offset;
  201.     long                        reserved;
  202.     char                        indexes[48];
  203. };
  204. #if defined(powerc) || defined(__powerc)
  205. #pragma options align=reset
  206. #endif
  207.  
  208. typedef struct StyleTable StyleTable;
  209.  
  210. #if defined(powerc) || defined (__powerc)
  211. #pragma options align=mac68k
  212. #endif
  213. struct NameTable {
  214.     short                        stringCount;
  215.     Str255                        baseFontName;
  216. };
  217. #if defined(powerc) || defined(__powerc)
  218. #pragma options align=reset
  219. #endif
  220.  
  221. typedef struct NameTable NameTable;
  222.  
  223. #if defined(powerc) || defined (__powerc)
  224. #pragma options align=mac68k
  225. #endif
  226. struct KernPair {
  227.     char                        kernFirst;                        /*1st character of kerned pair*/
  228.     char                        kernSecond;                        /*2nd character of kerned pair*/
  229.     short                        kernWidth;                        /*kerning in 1pt fixed format*/
  230. };
  231. #if defined(powerc) || defined(__powerc)
  232. #pragma options align=reset
  233. #endif
  234.  
  235. typedef struct KernPair KernPair;
  236.  
  237. #if defined(powerc) || defined (__powerc)
  238. #pragma options align=mac68k
  239. #endif
  240. struct KernEntry {
  241.     short                        kernLength;                        /*length of this entry*/
  242.     short                        kernStyle;                        /*style the entry applies to*/
  243. };
  244. #if defined(powerc) || defined(__powerc)
  245. #pragma options align=reset
  246. #endif
  247.  
  248. typedef struct KernEntry KernEntry;
  249.  
  250. #if defined(powerc) || defined (__powerc)
  251. #pragma options align=mac68k
  252. #endif
  253. struct KernTable {
  254.     short                        numKerns;                        /*number of kerning entries*/
  255. };
  256. #if defined(powerc) || defined(__powerc)
  257. #pragma options align=reset
  258. #endif
  259.  
  260. typedef struct KernTable KernTable;
  261.  
  262. #if defined(powerc) || defined (__powerc)
  263. #pragma options align=mac68k
  264. #endif
  265. struct WidthTable {
  266.     Fixed                        tabData[256];                    /*character widths*/
  267.     Handle                        tabFont;                        /*font record used to build table*/
  268.     long                        sExtra;                            /*space extra used for table*/
  269.     long                        style;                            /*extra due to style*/
  270.     short                        fID;                            /*font family ID*/
  271.     short                        fSize;                            /*font size request*/
  272.     short                        face;                            /*style (face) request*/
  273.     short                        device;                            /*device requested*/
  274.     Point                        inNumer;                        /*scale factors requested*/
  275.     Point                        inDenom;                        /*scale factors requested*/
  276.     short                        aFID;                            /*actual font family ID for table*/
  277.     Handle                        fHand;                            /*family record used to build up table*/
  278.     Boolean                        usedFam;                        /*used fixed point family widths*/
  279.     unsigned char                aFace;                            /*actual face produced*/
  280.     short                        vOutput;                        /*vertical scale output value*/
  281.     short                        hOutput;                        /*horizontal scale output value*/
  282.     short                        vFactor;                        /*vertical scale output value*/
  283.     short                        hFactor;                        /*horizontal scale output value*/
  284.     short                        aSize;                            /*actual size of actual font used*/
  285.     short                        tabSize;                        /*total size of table*/
  286. };
  287. #if defined(powerc) || defined(__powerc)
  288. #pragma options align=reset
  289. #endif
  290.  
  291. typedef struct WidthTable WidthTable;
  292.  
  293. #if defined(powerc) || defined (__powerc)
  294. #pragma options align=mac68k
  295. #endif
  296. struct FamRec {
  297.     short                        ffFlags;                        /*flags for family*/
  298.     short                        ffFamID;                        /*family ID number*/
  299.     short                        ffFirstChar;                    /*ASCII code of 1st character*/
  300.     short                        ffLastChar;                        /*ASCII code of last character*/
  301.     short                        ffAscent;                        /*maximum ascent for 1pt font*/
  302.     short                        ffDescent;                        /*maximum descent for 1pt font*/
  303.     short                        ffLeading;                        /*maximum leading for 1pt font*/
  304.     short                        ffWidMax;                        /*maximum widMax for 1pt font*/
  305.     long                        ffWTabOff;                        /*offset to width table*/
  306.     long                        ffKernOff;                        /*offset to kerning table*/
  307.     long                        ffStylOff;                        /*offset to style mapping table*/
  308.     short                        ffProperty[9];                    /*style property info*/
  309.     short                        ffIntl[2];                        /*for international use*/
  310.     short                        ffVersion;                        /*version number*/
  311. };
  312. #if defined(powerc) || defined(__powerc)
  313. #pragma options align=reset
  314. #endif
  315.  
  316. typedef struct FamRec FamRec;
  317.  
  318. #ifdef __cplusplus
  319. extern "C" {
  320. #endif
  321.  
  322. extern pascal void InitFonts(void)
  323.  ONEWORDINLINE(0xA8FE);
  324. extern pascal void GetFontName(short familyID, Str255 name)
  325.  ONEWORDINLINE(0xA8FF);
  326. extern pascal void GetFNum(ConstStr255Param name, short *familyID)
  327.  ONEWORDINLINE(0xA900);
  328. extern pascal Boolean RealFont(short fontNum, short size)
  329.  ONEWORDINLINE(0xA902);
  330. extern pascal void SetFontLock(Boolean lockFlag)
  331.  ONEWORDINLINE(0xA903);
  332. extern pascal FMOutPtr FMSwapFont(const FMInput *inRec)
  333.  ONEWORDINLINE(0xA901);
  334. extern pascal void SetFScaleDisable(Boolean fscaleDisable)
  335.  ONEWORDINLINE(0xA834);
  336. extern pascal void FontMetrics(const FMetricRec *theMetrics)
  337.  ONEWORDINLINE(0xA835);
  338. extern pascal void SetFractEnable(Boolean fractEnable);
  339. extern pascal Boolean IsOutline(Point numer, Point denom)
  340.  TWOWORDINLINE(0x7000, 0xA854);
  341. extern pascal void SetOutlinePreferred(Boolean outlinePreferred)
  342.  TWOWORDINLINE(0x7001, 0xA854);
  343. extern pascal Boolean GetOutlinePreferred(void)
  344.  TWOWORDINLINE(0x7009, 0xA854);
  345. extern pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
  346.  TWOWORDINLINE(0x7008, 0xA854);
  347. extern pascal void SetPreserveGlyph(Boolean preserveGlyph)
  348.  TWOWORDINLINE(0x700A, 0xA854);
  349. extern pascal Boolean GetPreserveGlyph(void)
  350.  TWOWORDINLINE(0x700B, 0xA854);
  351. extern pascal OSErr FlushFonts(void)
  352.  TWOWORDINLINE(0x700C, 0xA854);
  353. extern void getfnum(char *theName, short *familyID);
  354. extern void getfontname(short familyID, char *theName);
  355. extern pascal short GetDefFontSize(void)
  356.  FIVEWORDINLINE(0x3EB8, 0x0BA8, 0x6604, 0x3EBC, 0x000C);
  357. #if USESCODEFRAGMENTS
  358. extern pascal short GetSysFont(void);
  359. extern pascal short GetAppFont(void);
  360. #else
  361. #define GetSysFont() (* (short*) 0x0BA6)
  362.  
  363. #define GetAppFont() (* (short*) 0x0984)
  364.  
  365. #endif
  366.  
  367. #ifdef __cplusplus
  368. }
  369. #endif
  370.  
  371. #endif
  372.  
  373.